import { createRouter, createWebHistory } from 'vue-router'
import LayoutView from '../views/LayoutView.vue'
import ShouyeView from '../views/shouyeView.vue'
import NoticeManageView from '@/views/NoticeManageView.vue'
import ShopListView from '@/views/ShopListView.vue'
import UserListView from '@/views/UserListView.vue'
import ShopClassifyView from '@/views/ShopClassifyView.vue'
import LunBotuClassfyView from '@/views/lunBotuClassfyView.vue'
import LunBotuListView from '@/views/lunBotuListView.vue'
import OrdersView from '@/views/OrdersView.vue'
import ForumsView from '@/views/ForumsView.vue'
import CommentsView from '@/views/CommentsView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: LayoutView,
      // 路由重定向
      redirect: '/shouye',
      children: [
        {
          path: '/shouye',
          name: 'shouye',
          component: ShouyeView,
        },
        {
          path: '/NoticeManage',
          name: 'NoticeManage',
          component: NoticeManageView,
        },
        {
          path: '/ShopList',
          name: 'ShopList',
          component: ShopListView,
        },
        {
          path: '/UserList',
          name: 'UserList',
          component: UserListView,
        },
        {
          path: '/ShopClassify',
          name: 'ShopClassify',
          component: ShopClassifyView,
        },
        {
          path: '/LunBotuClassfy',
          name: 'LunBotuClassfy',
          component: LunBotuClassfyView,
        },
        {
          path: '/LunBotuList',
          name: 'LunBotuList',
          component: LunBotuListView,
        },
        {
          path: '/Orders',
          name: 'Orders',
          component: OrdersView,
        },
        {
          path: '/Forums',
          name: 'Forums',
          component: ForumsView,
        },
        {
          path: '/Comments',
          name: 'Comments',
          component: CommentsView,
        },
      ],
    },

    {
      path: '/login',
      name: 'login',
      component: () => import('../views/LoginView.vue'),
    },
    {
      path: '/reg',
      name: 'reg',
      component: () => import('../views/RegViews.vue'),
    },
  ],
})

export default router
